<?php 
define('NOROBOT', TRUE);
require_once './include/common.inc.php';
include_once './include/dtxx.inc.php';
$sql_dj="select * from bl_djsp where id='1' ";
$row_dj=$db->fetch_first($sql_dj);
//print_r($row_dj);
$mbdate=$row_dj['mbdate'];
$currentdate =date('Y-m-d');
$cadays=datediff('d',$currentdate,$mbdate);
//任务倒计时

//当前日况
$sql_day="select tdate,fsjzx,fsd,yssr from bl_scrk where `isdel`='0'  ORDER BY tdate DESC limit 10,1";
$row_day=$db->fetch_first($sql_day);
//print_r($row_day);

//计算月累计
$danmonth=date("Ym",strtotime($row_day['tdate']));
$sql_month="SELECT  sum(fsjzx) as fsjzx,sum(fsd) as fsd,sum(yssr) as yssr 
FROM  bl_scrk 
WHERE date_format(tdate,'%Y%m')  =  '$danmonth' and `isdel`='0' ";
$row_month=$db->fetch_first($sql_month);
//print_r($row_month);

//计算年累计
$danyear=date("Y",strtotime($row_day['tdate']));
$sql_year="SELECT  sum(fsjzx) as fsjzx,sum(fsd) as fsd,sum(yssr) as yssr 
FROM  bl_scrk 
WHERE date_format( tdate,'%Y')  =  '$danyear' and `isdel`='0' ";
$row_year=$db->fetch_first($sql_year);
//print_r($row_year);
//die();

//安全信息
$sql_aqxx="select * from bl_aqts  where isshow='1'";
$row_aqxx=$db->fetch_all($sql_aqxx);
//print_r($row_aqxx);

//动态信息
$sql_dtxx="select * from bl_news  where buid='2' order by tdate desc limit 8 ";
$row_dtxx=$db->fetch_all($sql_dtxx);
//print_r($row_dtxx);

//重要文电
$sql_zywd="select * from bl_news  where buid='3' order by tdate desc limit 8 ";
$row_zywd=$db->fetch_all($sql_zywd);
//print_r($row_zywd);
include template('index');
?>


